// tutorial.js

Page({
  navigateToTutorial(event) {
    const type = event.currentTarget.dataset.type;
    let url = '';

    // 根据不同类型的废品，设置跳转的页面路径
    switch (type) {
      case 'paper':
        url = '/pages/tutorialDetail/tutorialDetail?type=paper';
        break;
      case 'plastic':
        url = '/pages/tutorialDetail/tutorialDetail?type=plastic';
        break;
      case 'glass':
        url = '/pages/tutorialDetail/tutorialDetail?type=glass';
        break;
      case 'metal':
        url = '/pages/tutorialDetail/tutorialDetail?type=metal';
        break;
      default:
        break;
    }

    if (url) {
      // 跳转到对应类型的教程页面
      wx.navigateTo({
        url: url
      });
    }
  }
});